/*************************************************************************
	> File Name: P10448.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2024-12-17 10:48:15
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int n, m;
int arr[50];

void dfs(int k, int start) {
    if (k == m + 1) {
        for (int i = 1; i <= m; i++) {
            cout << arr[i] << " ";
        }
        cout << endl;
        return ;
    }
    for (int i = start; i + m - k<= n; i++) {
        arr[k] = i;
        dfs(k + 1, i + 1);
    }
    return ;
}

int main() {
    cin >> n >> m;
    dfs(1, 1);
    return 0;
}
